var Ajax = ZFT.Util.Ajax;
var STip = ZFT.Util.STip;
var Main = ZFT.Util.Class({
    container: $("#pms"),
    init: function () {
        var _this = this;
        _this.getPermission()
    },
    getPermission: function () {
        var _this = this;
        $.ajax({
            "url": "/index/index/getPower",
            type: "POST",
            async: false
        }).done(function (res) {
            if (res.code == 200) {
                var permision = _this.transArrToStr(res.data.menu);
                $("#pms").attr("data-btn-pms", permision);
            } else {
                return STip("fail", res.msg);
            }
        })
        /*  Ajax("/index/index/getPower",{
            type:"POST",
            dataType:"json",
            success:function(res){
                if(res.code==200){
                    var permision=_this.transArrToStr(res.data.menu);
                    $("#pms").attr("data-btn-pms",permision);
                }else{
                    return STip("fail",res.msg);
                }
            }
        })  */
    },
    transArrToStr: function (data) {
        var arr = [];
        for (var i = 0, len = data.length; i < len; i++) {
            if (data[i].type == 3) {
                arr.push(data[i].id);
            }
        }
        return arr.join(",");
    }


})
    (function () {
        new Main();
    })